package ru.st.selenium.applogic2;

import java.util.List;

import ru.st.selenium.applogic.FilmHelper;
import ru.st.selenium.model.Film;
import ru.st.selenium.pages.AddFilmPage;

public class FilmHelper2 extends DriverBasedHelper implements FilmHelper {

  public FilmHelper2(ApplicationManager2 manager) {
    super(manager.getWebDriver());
  }

  @Override
  public void create(Film film) {
	  pages.filmAddFilmPage.ensurePageLoaded()
	  	.SetTitle(film.getTitle())
	  	.SetYear(film.getYear())
	  	.SetNotes(film.getNotes())
	  	.ClickSaveButton();
  }

  @Override
  public void delete(Film film) {
    // TODO Auto-generated method stub

  }

  @Override
  public List<Film> search(String title) {
    // TODO Auto-generated method stub
    return null;
  }
  
  @Override
  public boolean isFilmCreated(Film film) {
	  return pages.filmFilmPage.waitPageLoaded();
  }
  
  @Override
  public boolean isFilmNotCreated(Film film) {
	  return pages.filmAddFilmPage.waitPageLoaded();
  }

}
